function transfer(selector) {
  const [tag, id, classname] = selector.split(/#|\./g);
  console.log(tag, id, classname);
  return `<${tag} id="${id}" class="${classname}"></${tag}>`
}

console.log(transfer("div#demo.demo"));
